<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
	<head>
		<title>查找员工</title>
		<link rel="stylesheet"
			href="${pageContext.request.contextPath }/css/base.css" />
		<link rel="stylesheet"
			href="${pageContext.request.contextPath }/css/info-mgt.css" />
		<link rel="stylesheet"
			href="${pageContext.request.contextPath }/css/WdatePicker.css" />

		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/jquery.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/common.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/WdatePicker.js"></script>
		<script type="text/javascript"
			src="${pageContext.request.contextPath }/js/jquery.pagination.js"></script>
	</head>

	<body>
		<form method="post"
			action="${pageContext.request.contextPath }/TrainMethod.action?method=selectUser">
			<div class="query">
				<div class="query-conditions ue-clear">
					<div class="conditions name ue-clear">
						<label>
							员工编号
						</label>
						<p class="long-input ue-clear">
							<input type="text" id="userid" name="userid">
						</p>
					</div>
					<div class="conditions name ue-clear">
						<label>
							员工姓名
						</label>
						<p class="long-input ue-clear">
							<input type="text" id="username" name="username">
						</p>
					</div>
					<div class="conditions name ue-clear">
						<label>
							员工部门
						</label>
						<p class="long-input ue-clear">
							<select name = "userdept">
								<option>请选择</option>
								<c:forEach items="${requestScope.dept}" var="dept" varStatus="c">
									<option>${dept.deptName }</option>
								</c:forEach>
							</select>
						</p>
					</div>
				</div>
				<div class="query-btn ue-clear">
					<input type="submit" id="submit" value="查询" />
					&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
					<input type="reset" id="reset" value="重置">
				</div>
			</div>
		</form>
		<div class="table-box">
			<table id="tbuser">
				<thead>
					<tr>
						<th class="num">
							员工编号
						</th>
						<th class="name">
							员工姓名
						</th>
						<th class="process">
							员工部门
						</th>
						<th class="operate">
							操作
						</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${requestScope.users}" var="wait" varStatus="c">
						<tr>
							<td class="name" value="${wait.userId }">
								${wait.userId }
							</td>
							<td class="process" value="${wait.userName }">
								${wait.userName }
							</td>
							<td class="node">
								${wait.userDeptId }
							</td>
							<td class="operate">
								<label style="cursor: pointer; color: blue" onclick=closewindow('${wait.userId }','${wait.userName }','${wait.userDeptId }','${wait.userStatus }');>
									选择
								</label>
							</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</body>
	<script type="text/javascript">
	

	function closewindow(userid,username,userdept,deptid) {
		window.opener.$("#username").val(username);
		window.opener.$("#userid").val(userid);
		window.opener.$("#deptname").val(userdept);
		window.opener.$("#deptid").val(deptid);
		self.close();
	}
</script>
</html>
